<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>详细信息</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/resource/layui/css/layui.css">
<link rel="stylesheet" href="/resource/css/global.css">
</head>
<body>
	<script src="/resource/js/jquery.min.js"></script>
	<script src="/resource/layui/layui.js"></script>
	<script src="/resource/js/essaydetail.js"></script>
	<div class="fly-header layui-bg-green">
		<div class="layui-container">
			<a class="fly-logo" href="/user/redirectIndex.do">
				<div class="layui-logo" style="font-size: 20px; color: #CAE1FF;"><span class="iconfont-ali icon-B" style="font-size: 35px"></span></div>
			</a>
			 <ul class="layui-nav fly-nav layui-hide-xs">
		      <li class="layui-nav-item layui-this">
		        <a href="/user/redirectIndex.do"><i class="layui-icon  layui-icon-home"></i> 首页</a>
		      </li>
    		</ul>
			<ul class="layui-nav fly-nav-user">

				<!-- 未登入的状态 -->
				<c:if test="${user==null }">
				<li class="layui-nav-item"><a
					class="iconfont-ali icon-yonghu layui-hide-xs" href="user/login.html"></a>
				</li>
				<li class="layui-nav-item"><a href="/login.html">登入</a></li>
				<li class="layui-nav-item"><a href="/register.html">注册</a></li>
				</c:if>
				<!-- 登入后的状态 -->
				<c:if test="${user!=null }">
					<li class="layui-nav-item"><a class="fly-nav-avatar"
						href="javascript:;"> <cite class="layui-hide-xs">${user.userName }</cite> 
						<img <c:if test="${!empty user.headSculpture }">src="${user.headSculpture }"</c:if><c:if test="${empty user.headSculpture }">src="/resource/img/logo.JPG"</c:if> alt="${user.userName}">
					</a>
						<dl class="layui-nav-child layui-bg-green">
							<dd>
								<a href="/user/userset.do"><i class="layui-icon">&#xe620;</i>基本设置</a>
							</dd>
							<dd>
								<a href="/user/usermessage.do"><i
									class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a>
							</dd>
							<dd>
								<a href="/user/userhome.do"><i class="layui-icon"
									style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a>
							</dd>
							<hr style="margin: 5px 0;">
							<dd>
								<dd><a href="/user/logout.do" ><i class="iconfont-ali icon-tuichu"></i>退出</a></dd>
							</dd>
						</dl></li>
				</c:if>
			</ul>
		</div>
	</div>
	<!--二级标题栏开始-->
	<div class="fly-panel fly-column">
		<div class="layui-container">
			<ul class="layui-clear">

				<li class="layui-hide-xs layui-this"><a href="/user/redirectIndex.do">首页</a></li>

				<!-- 用户登入后显示 -->
				<c:if test="${user!=null }">
						<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
							<a href="/user/userindex.do">我的</a>
						</li>				
					</c:if>
			</ul>
			<div class="fly-column-right layui-hide-xs">
				<span class="fly-search"><i class="layui-icon"></i></span> <a
					href="/essay/eassyadd.do" class="layui-btn">发表新帖</a>
			</div>
		</div>
	</div>
	<!--二级标题栏结束-->
	<div class="layui-container">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md1"></div>
			<div class="layui-col-md10 content detail">
				<div class="fly-panel detail-box">
					<center><h1>${essay.title }</h1></center>
					<div class="fly-detail-info">
						<span id="validity" class="iconfont-ali icon-dengji-" title="真实度">${essay.validity }%</span>
						<span class="fly-list-nums"> 
							<a href="#comment">
								<i class="iconfont" title="评论">&#xe60c;</i> ${essay.commentNumber }
							</a>
							 <i class="iconfont" title="阅读量">&#xe60b;</i> ${essay.readNumber }
						</span>
					</div>
					<div class="detail-about">
						${essay.user.userName }
						<a class="fly-avatar" href="../user/home.html"> 
						<img <c:if test="${!empty essay.user.headSculpture }">src="${essay.user.headSculpture }"</c:if><c:if test="${empty essay.user.headSculpture }">src="/resource/img/logo.JPG"</c:if> alt="${essay.user.userName}">
						</a>
						<div class="fly-detail-user">
							<a href="../user/home.html" class="fly-link"><cite></cite></a><br>
							<span>${essay.publishDate }</span>
						</div>
					</div>
					
					<c:if test="${!empty filelist }">
					<hr class="layui-bg-gray ">			
					<c:forEach items="${filelist }" var="file">
					     <div class="layui-col-md12"  >
					     <video src="${file.filePath }" controls="controls" width="100%" height="300px">
							您的浏览器不支持 video 标签。
						 </video>
					     </div>
					</c:forEach>
					</c:if>
					<hr class="layui-bg-green">
					<div class="detail-body ">
						<p>
							${essay.description }
						</p>
					</div>
					<button id="collcet" essayId="${essay.essayId }" class="layui-btn layui-btn-fluid">收藏</button>
				</div>
				<div class="fly-panel detail-box" id="flyReply">
					<fieldset class="layui-elem-field layui-field-title"
						style="text-align: center;">
						<legend>评论</legend>
					</fieldset>
					<c:if test="${essay.commentNumber!=0 }">
					<c:forEach items="${commentlist }" var="comment">
					<ul class="pinglun" id="pinglun">
						<li data-id="111" class="jieda-daan"><a name="item-1111111111"></a>
							<div class="detail-about detail-about-reply">
								<a class="fly-avatar" href="/user/otheruserhome.do?userName=${comment.user.userName }">
								<img <c:if test="${!empty essay.user.headSculpture }">src="${essay.user.headSculpture }"</c:if><c:if test="${empty essay.user.headSculpture }">src="/resource/img/logo.JPG"</c:if> alt="${essay.user.userName}">
								</a>
								<div class="fly-detail-user">
									<a href="/user/otheruserhome.do?userName=${comment.user.userName }" class="fly-link"> <cite>${comment.user.userName }</cite>
									</a>
								</div>
								<div class="detail-hits">
									<span>${comment.commentDate }</span>
								</div>
							</div>
							<div class="detail-body jieda-body photos">
								<p>${comment.comment }</p>
							</div>
							</li>
							<hr>
							</c:forEach>
							</c:if>
						<!-- 无数据时 -->
						<c:if test="${essay.commentNumber==0 }">
						 <li class="fly-none">消灭零回复</li> 
						 </c:if>
					</ul>
					<hr class="layui-bg-green">
					<!-- 回复框 -->
					<div class="layui-form layui-form-pane">
						<form >
							<div class="layui-form-item layui-form-text">
								<a id="comment"></a>
								<div class="layui-input-block">
									<textarea id="L_content" name="content" 
										lay-verify="content" placeholder="请输入内容"
										class="layui-textarea fly-editor" style="height: 150px;"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<button class="layui-btn layui-btn-fluid" lay-filter="submit" lay-submit essayId=${essay.essayId }>提交回复</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="fly-footer">
		<p>
			<p>Believe 社区 2019 &copy; 千夜 出品</p>
		</p>
	</div>
	<script src="/resource/js/common.js"></script>
</body>
</html>

